package com.huawei.gamebox.service.welfare.campaign.card;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout.LayoutParams;
import androidx.recyclerview.widget.RecyclerView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.gamebox.service.common.cardkit.card.HorizonBaseCard;
import com.huawei.gamebox.service.common.cardkit.card.HorizonBaseCard.a;
import com.huawei.gamebox.service.common.cardkit.card.HorizonBaseCard.a.b;
import com.huawei.gamebox.service.welfare.campaign.bean.CampaignSildeCardBean;
import o.chc;
import o.exp$a;
import o.exp.j;
import o.fbs;

public class CampaignSideslipCard extends HorizonBaseCard {

    class d extends a {
        final /* synthetic */ CampaignSideslipCard ˋ;

        class e extends b {
            private fbs ॱˋ;
            final /* synthetic */ d ᐝॱ;

            e(d dVar, View view) {
                this.ᐝॱ = dVar;
                super(dVar, view);
                this.ॱˋ = new fbs(view.getContext(), false);
                this.ॱˋ.ॱ(dVar.ˋ.ˊ.ॱ() + (dVar.ˋ.ˊ.ॱॱ() * (dVar.ˋ.ˏ + 2)));
                this.ॱˋ.ˊ(dVar.ˋ.ˏ);
                this.ॱˋ.ˏ(view);
                this.ॱˋ.ˉ().setClickable(true);
                this.ʻॱ = view;
                this.ॱˋ.ॱ(dVar.ˋ.ˋ());
            }
        }

        private d(CampaignSideslipCard campaignSideslipCard) {
            this.ˋ = campaignSideslipCard;
            super(campaignSideslipCard);
        }

        public b ॱ(ViewGroup viewGroup, int i) {
            View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(j.ॱʻ, viewGroup, false);
            ((LayoutParams) ((LinearLayout) inflate.findViewById(o.exp.d.ʻᐝ)).getLayoutParams()).bottomMargin = this.ˋ.ʼॱ.getResources().getDimensionPixelSize(exp$a.ʽॱ);
            return new e(this, inflate);
        }

        public void ˋ(b bVar, int i) {
            CampaignSildeCardBean campaignSildeCardBean = (CampaignSildeCardBean) this.ˋ.ˊᐝ;
            if (bVar instanceof e) {
                CardBean cardBean = (CardBean) campaignSildeCardBean.ᐝ().get(i);
                cardBean.ˋˋ(campaignSildeCardBean.ॱˉ());
                ((e) bVar).ॱˋ.ˏ(cardBean);
            }
        }

        public int ˏ() {
            CardBean ˌ = this.ˋ.ˌ();
            if (ˌ instanceof CampaignSildeCardBean) {
                CampaignSildeCardBean campaignSildeCardBean = (CampaignSildeCardBean) ˌ;
                if (campaignSildeCardBean.ᐝ() != null) {
                    return campaignSildeCardBean.ᐝ().size();
                }
            }
            return 0;
        }
    }

    public CampaignSideslipCard(Context context) {
        super(context);
    }

    public void ʻ() {
        this.ˏ = chc.ˊॱ();
    }

    public RecyclerView.a ˊॱ() {
        return new d();
    }
}
